package com.bilibili.service.impl;

import java.time.LocalDate;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.bilibili.dao.BackDataDao;
import com.bilibili.dao.impl.BackDataDaoImpl;
import com.bilibili.service.BackDataService;

public class BackDataServiceImpl implements BackDataService {
    BackDataDao bdd = new BackDataDaoImpl();

    @Override
    public Map<String, Object> selectCount() {
        Map<String, Object> result = new HashMap<>();
        result.put("statVideo", bdd.selectStatVideo());
        result.put("content", bdd.selectContent());
        result.put("videoPlay", bdd.selectVideoPlay());
        result.put("allComment", bdd.selectAllComment());
        return result;
    }

    @Override
    public Map<String, Object> selectTables(String timeRange) {
        Map<String, Object> result = new HashMap<>();
        result.put("videoStatus", bdd.queryVideoStatus());
        result.put("videoTrend", bdd.selectVideoTrend(timeRange));
        System.out.println(bdd.selectVideoTrend(timeRange));
        return result;
    }
}
